package com.lab.book.common.dto;

import java.io.Serializable;

import javax.validation.constraints.Min;

import com.lab.cloud.common.validation.group.First;
import com.lab.cloud.common.validation.group.Second;
import org.hibernate.validator.constraints.Length;

import com.lab.book.common.validation.group.SearchGroup;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel(value = "用户搜索对象")
@Data
public class SearchUserDTO implements Serializable {
	private static final long serialVersionUID = -7107041350695057544L;

	@ApiModelProperty(value = "用户名称", hidden = false, required = false)
	@Length(max = 16, message = "用户名2到16个字符", groups = { First.class, SearchGroup.class })
	private String name;

	@ApiModelProperty(value = "用户年龄", hidden = false, required = false)
	@Min(value = 18, message = "年龄最小18岁", groups = { Second.class, SearchGroup.class })
	private Integer age;
}
